UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AazafvZMWuVrJmOFOy2QnXOnGZlqriKU9thhjDVwDWg='
WHERE
key_id = '83bb61dd35d1fce731985d54d2c01a0daaba6d9280ee92750c9421d6d03bbe32'
AND (
token = 'AazafvZMWuVrJmOFOy2QnXOnGZlqriKU9thhjDVwDWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)