UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SIy+QVLHSxgTYxH4k6rQfSFFcQHhiY5ffqDZd7MpeeY='
WHERE
key_id = '06b2ab407e48726d28f9764b910057feb000bd0ee4a9179c6b95f8d53ebdfdcf'
AND (
token = 'SIy+QVLHSxgTYxH4k6rQfSFFcQHhiY5ffqDZd7MpeeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)