UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MfDssB8AempYThpr0IKPuI6goKoeqtIO4oH8zwqtgY8='
WHERE
key_id = 'f7e8f830373a1003563eee4cd7053de5764470b4c9a5bd29f937c8f7caa8f856'
AND (
token = 'MfDssB8AempYThpr0IKPuI6goKoeqtIO4oH8zwqtgY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)