UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5cW4/55gjszxIbDa06lN1q7TU6/BqGOqCIuaiOjkHkk='
WHERE
key_id = '13798cea44721a93d15d40da7d9427e8fb2f050a4fe6902f07b5d2c927e86d17'
AND (
token = '5cW4/55gjszxIbDa06lN1q7TU6/BqGOqCIuaiOjkHkk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)