UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QssLej4BwV/nHuWWHXArhgGkKLRpI1es8CPjL6njl7E='
WHERE
key_id = 'b436cfdd75fcf198b4177fa47e35975e8be3609708d69a7b97df9068315e96fd'
AND (
token = 'QssLej4BwV/nHuWWHXArhgGkKLRpI1es8CPjL6njl7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)