UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/KBOWIR7EYA41xM4DH34h6lcSlch/PYS1pMkX0USGgw='
WHERE
key_id = 'e3821f481da3ec6a4f05932e21d35a21c42dcabdcdb846d6b730917ecaea0a30'
AND (
token = '/KBOWIR7EYA41xM4DH34h6lcSlch/PYS1pMkX0USGgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)