UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'msBTB9Itcs+3Owo3TLxRdaP1P5Do8Vzru80nIKLMk+0='
WHERE
key_id = 'c10b3a9810ef7d5fc6ecb08947e2e536968e641ced4471276b15c0dcd4d163e0'
AND (
token = 'msBTB9Itcs+3Owo3TLxRdaP1P5Do8Vzru80nIKLMk+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)