UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TH0Mt75GTL1hNjpjw0OABNfTJVINRCSAuCAHHAd5M2k='
WHERE
key_id = '80574d951df3959bd534d1624a452fc12878318905b5e1a9988c760b000635e1'
AND (
token = 'TH0Mt75GTL1hNjpjw0OABNfTJVINRCSAuCAHHAd5M2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)