UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ItxkOy9j7+SsYnHIbOCHFVrBurWHPhhpG40nPtdWPDM='
WHERE
key_id = '3ee2c6b7decf750d8aaecf2645632d6ed5b4a4a31ab0832cb9de2c59e826a9b3'
AND (
token = 'ItxkOy9j7+SsYnHIbOCHFVrBurWHPhhpG40nPtdWPDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)