UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bqvCCz3PX7KJJpOks7lAQmHCPET5UYzCw3s8sj3Gqno='
WHERE
key_id = '1ef98ed6c2cb3ebedf391ba657c0ebd64b38cd16a6bad0d73bb4d045a50d3fda'
AND (
token = 'bqvCCz3PX7KJJpOks7lAQmHCPET5UYzCw3s8sj3Gqno='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)