UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f8fS9oTDMrB//cjRdoUUeH9YZN6E5ZXc56MEIqf2ylI=' 
WHERE 
  key_id = '694230b4b08614e2eb113d4df28c7d7cf990059b1636071226fad677e1ed6807' 
  AND (
    token = 'f8fS9oTDMrB//cjRdoUUeH9YZN6E5ZXc56MEIqf2ylI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017