UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lmXuPVwHfNg2CpWc+7LYOwTYRrpljFqN7DEvaX8uGTY='
WHERE
key_id = '685a6837885ffc40b94ea481bc18867e63567e683919db90e791a3e09b03e237'
AND (
token = 'lmXuPVwHfNg2CpWc+7LYOwTYRrpljFqN7DEvaX8uGTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)