UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nlcKzUQPQ5LogJEC6ZCvk/Dry9XvIHRT2M8hS3Z6mBQ='
WHERE
key_id = 'ae1a9c1aa7b09db67f5535dda95bbb1f7725fa95b71c16a26e60d15f1a650e23'
AND (
token = 'nlcKzUQPQ5LogJEC6ZCvk/Dry9XvIHRT2M8hS3Z6mBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)