UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2/qO63VzZG0FbL+DVJEu34eHJvVwLc7/qJyLqJiip2M='
WHERE
key_id = '684dbdc63ecfdbd9a929fc9a18cf946b4052ee1d959956ec37190ba3b1551672'
AND (
token = '2/qO63VzZG0FbL+DVJEu34eHJvVwLc7/qJyLqJiip2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)