UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0aqrOBteVTlcu9Y0ihXqZ37dct0m3/FXTyKact+jCPE='
WHERE
key_id = '35f1fa739e03fb039957e3d923c83350602471df4b69dc33c1b42da990516d9b'
AND (
token = '0aqrOBteVTlcu9Y0ihXqZ37dct0m3/FXTyKact+jCPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)