UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XD6wpPtTigGqtdW80RA5PHznXdHy0H04skF8R1NruPg='
WHERE
key_id = 'fc44bc47c7cf8cca020726dfd9ec49d7338d3ee40ca7b480bbc3a574c0942e13'
AND (
token = 'XD6wpPtTigGqtdW80RA5PHznXdHy0H04skF8R1NruPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)