UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S43FPNbjmudBy4v6TbXIH2oWbSs1sT+mK919lEM4IR0='
WHERE
key_id = 'eed438aae52f87445f9a8ea3946777cf4d19767d14ae5040b5eaf9fba08cdf07'
AND (
token = 'S43FPNbjmudBy4v6TbXIH2oWbSs1sT+mK919lEM4IR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)