UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7CfKxy8YZ2bjhTy1HPIQH2jYt7Pl8Rpq4hAirYUuvmI='
WHERE
key_id = '781e85e845645d9b938193b36c6398dc0d0dd35699ef0e889afddf03f3001fc6'
AND (
token = '7CfKxy8YZ2bjhTy1HPIQH2jYt7Pl8Rpq4hAirYUuvmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)