UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'evYn7jZzGDkpPyAEy92xGYzS/5SgQBCNOCI0+6k9oBY='
WHERE
key_id = 'c67dd329e70bc0d8c16d296d7aad16ba1a02c98700c2d7326f4606af74ffff05'
AND (
token = 'evYn7jZzGDkpPyAEy92xGYzS/5SgQBCNOCI0+6k9oBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)