UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '29Xi5BwLls8R71hWyZrulGpig8cM7PlTsQLiqDdp86E=' 
WHERE 
  key_id = '4a444435cfcdcf8d9db31c9dca7080e6e894549917b05663627b8acd44120fd7' 
  AND (
    token = '29Xi5BwLls8R71hWyZrulGpig8cM7PlTsQLiqDdp86E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049