UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1smoDqrJAkST300wevMmJZlOhzlzLImq37nBOFolSMM='
WHERE
key_id = '531fc91ecdff5e207d73e78c9138f5206b36f48b69bef27848cfa1e41acb1f87'
AND (
token = '1smoDqrJAkST300wevMmJZlOhzlzLImq37nBOFolSMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)