UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BFFJlEO3Sx6hlHKss9CtIcR7G4B5/Y5P8Z+mP/qGwdw='
WHERE
key_id = '66bcd7e641495993d09ce30c69357dbbdd6679a9876fd8732ce167dc0d84b423'
AND (
token = 'BFFJlEO3Sx6hlHKss9CtIcR7G4B5/Y5P8Z+mP/qGwdw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)