UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8DgxK6pf/i5qVvBJDZfKOjqF80bdlQqXOeBAzwf6oAo=' 
WHERE 
  key_id = '35caef1b95bfc05bc240cab22f3866bdfe0a6e2bfcef0cfd6adc170edb259301' 
  AND (
    token = '8DgxK6pf/i5qVvBJDZfKOjqF80bdlQqXOeBAzwf6oAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021