UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GGv8MmLWWC1TzEGZLofsHRWaHsB7EE0QgfBiNmsS4RA='
WHERE
key_id = '1348ae79dfcb59a75b828678fe651885b9902137328268c7a4e6589dcdf375d6'
AND (
token = 'GGv8MmLWWC1TzEGZLofsHRWaHsB7EE0QgfBiNmsS4RA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)