UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sq3d8HTnOWvYz2AnxGeb6oNKUHKF7Ah1hcULLfhmq4E='
WHERE
key_id = '16a8dc0de70f9b50748b1bc4ccd14b244d7da127a1129205f79546b5ce077cb3'
AND (
token = 'sq3d8HTnOWvYz2AnxGeb6oNKUHKF7Ah1hcULLfhmq4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)