UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S37vT1wZOIj1TbEmlylcgS7uq9sl/AAP9GRtT8kmNVk='
WHERE
key_id = '3f57fc847372fb9c6a5d468d1469a0aaef4d082b730b0d0c6d357da92c49549d'
AND (
token = 'S37vT1wZOIj1TbEmlylcgS7uq9sl/AAP9GRtT8kmNVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)