UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wLsk2/NIISrc6ZPFTLtwrsogCR/W6U/hbr/xMsQChPo='
WHERE
key_id = 'ecc40eca46d48592588bf6cae1c2505b40b66fcffd47d5012589db52180b4c5d'
AND (
token = 'wLsk2/NIISrc6ZPFTLtwrsogCR/W6U/hbr/xMsQChPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)