UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gspXCbx0hp9YeJ2RgVLGKm/PhsILalvYdxkn40sUKmU='
WHERE
key_id = '2aea4341510316c3c31a22b22a42fbb7211074714ba778307398feb88538b00e'
AND (
token = 'gspXCbx0hp9YeJ2RgVLGKm/PhsILalvYdxkn40sUKmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)