UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '71MrCNMgEsAmezT5TRtmNluZnRbHO8/rOJuzLmv8JH8='
WHERE
key_id = 'a3a8a72fc7a1121a0a4cfd294c99820d83e924968e55c9ddb7c90a03b9ea19a9'
AND (
token = '71MrCNMgEsAmezT5TRtmNluZnRbHO8/rOJuzLmv8JH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)